package MaintMenu.VenPricingUpdTBLN;// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.

import javax.swing.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class Trn6Category
{

    public Trn6Category(){
        long tStart = 0;
        long tStop =0;
        long tTotal = System.currentTimeMillis();

        try
        {
            tStart = System.currentTimeMillis();
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String dataSourceName = "dbLI";
            String dbURL = (new StringBuilder()).append("jdbc:odbc:").append(dataSourceName).toString();
            Connection con = DriverManager.getConnection(dbURL, "", "");
            Statement st = con.createStatement();
            Statement st1 = con.createStatement();
            Statement st2 = con.createStatement();
            Statement st3 = con.createStatement();
            Statement st4 = con.createStatement();
            Statement st5 = con.createStatement();
            Statement st6 = con.createStatement();


            //System.out.println("Begin");


            try
            {
                //System.out.println("MAST to CATs");
                st.execute("INSERT INTO TBLBCN ( [PART#], SUPPLIER, DESCRIPTION, T24m, T12m, 12MSL, 9msl, 6MSL, 3MSL, INSTOCK, 1mns, 1M, 1_5M, 2M, 3M, 4M, 5M, ONORDER, SHIPPING, TYG_TW, TYG_TX, GD, PROTEC, TYG_TW_P, TYG_TX_P, GD_P, PROTEC_P, TYG_TW_K, TYG_TX_K, GD_K, PROTEC_K, [TYG_TW#], [TYG_TX#], [GD#], [PROTEC#], REMARK, DNK_MEMO, TYG_TW_MEMO, TYG_TX_MEMO, GD_MEMO, PROTEC_MEMO, RATE, TYG_TW_C, TYG_TX_C, GD_C, PROTEC_C, TYG_TW_BO, TYG_TX_BO, GD_BO, PROTEC_BO, OEM_NO, PARTLINK, SUGGEST, TYG_TW_STATUS, TYG_TX_STATUS, GD_STATUS, PROTEC_STATUS, NEW, CAPA, MANUAL ) " +
                        "SELECT ITEM_NO, SUPP, DESCRIPT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, IIF(ISNULL(TYG_PRC),0,TYG_PRC), IIF(ISNULL(TX_PRC),0,TX_PRC), IIF(ISNULL(GD_PRC),0,GD_PRC), IIF(ISNULL(PROTEC_PRC),0,PROTEC_PRC), IIF(ISNULL(TYG_PKG),0,TYG_PKG), IIF(ISNULL(TYG_PKG),0,TYG_PKG), IIF(ISNULL(GD_PKG),0,GD_PKG), IIF(ISNULL(PROTEC_PKG),0,PROTEC_PKG), TYG_NO, TX_NO, GD_NO, PROTEC_NO, NULL, DNK_NOTE1, TYG_REMARK, TX_REMARK, GD_REMARK, NULL, 0, IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(GD_CUFT),0,GD_CUFT), IIF(ISNULL(PROT_CUFT),0,PROT_CUFT), 0, 0, 0, 0, PART_NO, PARTLINK, 0, NULL, NULL, NULL, NULL, 0, IIF(CAPA='Y',-1,0), 0 " +
                        "FROM BCMAST " +
                        "WHERE ITEM_NO NOT IN (SELECT [PART#] FROM TBLBCN);");
                //System.out.println("BC done");

                st.execute("INSERT INTO TBLCLN ( [PART#], SUPPLIER, DESCRIPTION, T24m, T12m, 12MSL, 9msl, 6MSL, 3MSL, INSTOCK, 1mns, 1M, 1_5M, 2M, 3M, 4M, 5M, ONORDER, SHIPPING, TYG_TW, TYG_TX, GD, GN, TYG_TW_P, TYG_TX_P, GD_P, GN_P, TYG_TW_K, TYG_TX_K, GD_K, GN_K, [TYG_TW#], [TYG_TX#], [GD#], [GN#], REMARK, DNK_MEMO, TYG_TW_MEMO, TYG_TX_MEMO, GD_MEMO, GN_MEMO, RATE, TYG_TW_C, TYG_TX_C, GD_C, GN_C, TYG_TW_BO, TYG_TX_BO, GD_BO, GN_BO, OEM_NO, PARTLINK, SUGGEST, TYG_TW_STATUS, TYG_TX_STATUS, GD_STATUS, GN_STATUS, NEW, CAPA, MANUAL, DEPO_P,	DEPO_K,	[DEPO#] ) " +
                        "SELECT ITEM_NO, NULL, DESCRIPT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, IIF(ISNULL(TW_TYGPRC),0,TW_TYGPRC), IIF(ISNULL(TX_TYGPRC),0,TX_TYGPRC), IIF(ISNULL(GD_PRC),0,GD_PRC), IIF(ISNULL(GN_PRC),0,GN_PRC), IIF(ISNULL(TW_TYGPKG),0,TW_TYGPKG), IIF(ISNULL(TX_TYGPKG),0,TX_TYGPKG), IIF(ISNULL(GD_PKG),0,GD_PKG), IIF(ISNULL(GN_PKG),0,GN_PKG), TW_TYGNO, TX_TYGNO, GD_NO, GN_NO, NULL, REMARK, TYG_REMARK, NULL, GD_REMARK, NULL, 0, IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(GD_CUFT),0,GD_CUFT), 0, 0, 0, 0, 0, PART_NO, PARTLINK, 0, NULL, NULL, NULL, NULL, 0, 0, 0, IIF(ISNULL(DEPO_PRC),0,DEPO_PRC),	IIF(ISNULL(DEPO_PKG),0,DEPO_PKG),	IIF(ISNULL(DEPO_NO),0,DEPO_NO)  " +
                        "FROM COOLNGM WHERE ITEM_NO NOT IN (SELECT [PART#] FROM TBLCLN);");
                //System.out.println("CL done");

                st.execute("INSERT INTO TBLHFN ( [PART#], SUPPLIER, DESCRIPTION, T24m, T12m, 12MSL, 9msl, 6MSL, 3MSL, INSTOCK, 1mns, 1M, 1_5M, 2M, 3M, 4M, 5M, ONORDER, SHIPPING, TYG_TW, TYG_TX, GD, TYG_TW_P, TYG_TX_P, GD_P, TYG_TW_K, TYG_TX_K, GD_K, [TYG_TW#], [TYG_TX#], [GD#], REMARK, DNK_MEMO, TYG_TW_MEMO, TYG_TX_MEMO, GD_MEMO, RATE, TYG_TW_C, TYG_TX_C, GD_C, TYG_TW_BO, TYG_TX_BO, GD_BO, OEM_NO, PARTLINK, SUGGEST, TYG_TW_STATUS, TYG_TX_STATUS, GD_STATUS, NEW, CAPA, MANUAL ) " +
                        "SELECT ITEM_NO, NULL, DESCRIPT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, IIF(ISNULL(TYG_PRC),0,TYG_PRC), IIF(ISNULL(TX_PRC),0,TX_PRC), IIF(ISNULL(GD_PRC),0,GD_PRC), IIF(ISNULL(TYG_PKG),0,TYG_PKG), IIF(ISNULL(TYG_PKG),0,TYG_PKG), IIF(ISNULL(GD_PKG),0,GD_PKG), TYG_NO, TX_NO, GD_NO, NULL, DNK_NOTE1, TYG_REMARK, NULL, GD_REMARK, 0, IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(GD_CUFT),0,GD_CUFT), 0, 0, 0, PART_NO, PARTLINK, 0, NULL, NULL, NULL, 0, IIF(CAPA='Y',-1,0), 0 " +
                        "FROM HFMAST WHERE ITEM_NO NOT IN (SELECT [PART#] FROM TBLHFN);");
                //System.out.println("HF done");

                st.execute("INSERT INTO TBLLTN ( [PART#], SUPPLIER, DESCRIPTION, t24m, t12m, 12MSL, 9msl, 6MSL, 3MSL, RATE, INSTOCK, 1mns, 1M, 1_5M, 2M, 3M, 4M, 5M, ONORDER, SHIPPING, GD, GENERA, DEPO, ee, REMARK, DNK_MEMO, GD_MEMO, GENERA_MEMO, DEPO_MEMO, EE_MEMO, NEW, GD_P, GENERA_P, DEPO_P, ee_p, GD_K, GENERA_K, DEPO_K, EE_K, [GD#], [GENERA#], [DEPO#], [EE#], GD_C, GENERA_C, DEPO_C, EE_C, GD_BO, GENERA_BO, DEPO_BO, EE_BO, OEM_NO, PARTLINK, SUGGEST, CAPA ) " +
                        "SELECT ITEM_NO, SUPPLIER, DESCRIPT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, REMARK, GD_REMARK, NULL, NULL, NULL, 0, IIF(ISNULL(GD_PRC),0,GD_PRC), IIF(ISNULL(TYC_PRC),0,TYC_PRC), IIF(ISNULL(DEPO_PRC),0,DEPO_PRC), IIF(ISNULL(EAGLEPRC),0,EAGLEPRC), IIF(ISNULL(GD_PKG),0,GD_PKG), IIF(ISNULL(TYC_PKG),0,TYC_PKG), IIF(ISNULL(DEPO_PKG),0,DEPO_PKG), IIF(ISNULL(EAGLEPKG),0,EAGLEPKG), GD_NO, TYC_NO, DEPO_NO, EAGLE_NO, IIF(ISNULL(GD_CUFT),0,GD_CUFT), 0, 0, 0, 0, 0, 0, 0, OEM_NO, PARTLINK, 0, IIF(CAPA = 'Y',-1,0) " +
                        "FROM LT_MAST1 WHERE ITEM_NO NOT IN (SELECT [PART#] FROM TBLLTN);");
                //System.out.println("LT done");

                st.execute("INSERT INTO TBLMRN ( [PART#], SUPPLIER, DESCRIPTION, T24m, T12m, 12MSL, 9msl, 6MSL, 3MSL, INSTOCK, 1mns, 1M, 1_5M, 2M, 3M, 4M, 5M, ONORDER, SHIPPING, TYG_TW, TYG_TX, GD, GN, KS, TYG_TW_P, TYG_TX_P, GD_P, GN_P, KS_P, KV_P, TYG_TW_K, TYG_TX_K, GD_K, GN_K, KS_K, KV_K, [TYG_TW#], [TYG_TX#], [GD#], [GN#], [KS#], [KV#], REMARK, DNK_MEMO, TYG_TW_MEMO, TYG_TX_MEMO, GD_MEMO, GN_MEMO, KS_MEMO, KV_MEMO, RATE, TYG_TW_C, TYG_TX_C, GD_C, GN_C, KS_C, TYG_TW_BO, TYG_TX_BO, GD_BO, GN_BO, KS_BO, OEM_NO, PARTLINK, SUGGEST, TYG_TW_STATUS, TYG_TX_STATUS, GD_STATUS, GN_STATUS, KS_STATUS, NEW, CAPA, MANUAL, DEPO_P,	DEPO_K,	[DEPO#] ) " +
                        "SELECT ITEM_NO, NULL, DESCRIPT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, IIF(ISNULL(TYG_TW_PRC),0,TYG_TW_PRC), IIF(ISNULL(TYG_TX_PRC),0,TYG_TX_PRC), IIF(ISNULL(GD_PRC),0,GD_PRC), IIF(ISNULL(GN_PRC),0,GN_PRC), IIF(ISNULL(AM_PRC),0,AM_PRC), IIF(ISNULL(KV_PRC),0,KV_PRC), IIF(ISNULL(TYG_TW_PKG),0,TYG_TW_PKG), IIF(ISNULL(TYG_TX_PKG),0,TYG_TX_PKG), IIF(ISNULL(GD_PKG),0,GD_PKG), IIF(ISNULL(GN_PKG),0,GN_PKG), IIF(ISNULL(AM_PKG),0,AM_PKG), IIF(ISNULL(KV_PKG),0,KV_PKG), TYG_TW_NO, TYG_TX_NO, GD_NO, GN_NO, AM_NO, KV_NO, NULL, REMARK, TYG_REMARK, TX_REMARK, GD_REMARK, GN_REMARK, NULL, KV_REMARK, 0, IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(GD_CUFT),0,GD_CUFT), 0, 0, 0, 0, 0, 0, 0, PART_NO, PARTLINK, 0, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, IIF(ISNULL(DEPO_PRC),0,DEPO_PRC),	IIF(ISNULL(DEPO_PKG),0,DEPO_PKG),	IIF(ISNULL(DEPO_NO),0,DEPO_NO) " +
                        "FROM MIRRORM1 WHERE ITEM_NO NOT IN (SELECT [PART#] FROM TBLMRN);");
                //System.out.println("MR done");

                st.execute("INSERT INTO TBLOTN ( [PART#], SUPPLIER, DESCRIPTION, T24m, T12m, 12MSL, 9msl, 6MSL, 3MSL, INSTOCK, 1mns, 1M, 1_5M, 2M, 3M, 4M, 5M, ONORDER, SHIPPING, TYG_TW, TYG_TX, GD, PROTEC, FEY, TYG_TW_P, TYG_TX_P, GD_P, PROTEC_P, FEY_P, TYG_TW_K, TYG_TX_K, GD_K, PROTEC_K, FEY_K, [TYG_TW#], [TYG_TX#], [GD#], [PROTEC#], [FEY#], REMARK, DNK_MEMO, TYG_TW_MEMO, TYG_TX_MEMO, GD_MEMO, PROTEC_MEMO, FEY_MEMO, RATE, TYG_TW_C, TYG_TX_C, GD_C, PROTEC_C, FEY_C, TYG_TW_BO, TYG_TX_BO, GD_BO, PROTEC_BO, FEY_BO, OEM_NO, PARTLINK, SUGGEST, TYG_TW_STATUS, TYG_TX_STATUS, GD_STATUS, PROTEC_STATUS, FEY_STATUS, NEW, CAPA, MANUAL ) " +
                        "SELECT ITEM_NO, SUPP, DESCRIPT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, IIF(ISNULL(TYG_PRC),0,TYG_PRC), IIF(ISNULL(TX_PRC),0,TX_PRC), IIF(ISNULL(GD_PRC),0,GD_PRC), IIF(ISNULL(PROTEC_PRC),0,PROTEC_PRC), 0, IIF(ISNULL(TYG_PKG),0,TYG_PKG), IIF(ISNULL(TYG_PKG),0,TYG_PKG), IIF(ISNULL(GD_PKG),0,GD_PKG), IIF(ISNULL(PROTEC_PKG),0,PROTEC_PKG), 0, TYG_NO, TX_NO, GD_NO, PROTEC_NO, NULL, NULL, DNK_NOTE1, TYG_REMARK, TX_REMARK, GD_REMARK, NULL, NULL, 0, IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(GD_CUFT),0,GD_CUFT), IIF(ISNULL(PROT_CUFT),0,PROT_CUFT), 0, 0, 0, 0, 0, 0, PART_NO, PARTLINK, 0, NULL, NULL, NULL, NULL, NULL, 0, IIF(CAPA='Y',-1,0), 0 " +
                        "FROM OTMAST WHERE ITEM_NO NOT IN (SELECT [PART#] FROM TBLOTN);");
                //System.out.println("OT done. MAST to CATs complete\n");


                tStop = System.currentTimeMillis();
                //System.out.print("\nStep 1/3 (MAST TO CATs): " + (tStop - tStart) / 1000 + " Seconds");
                tStart = System.currentTimeMillis();
                //ORG
//                st.execute("INSERT INTO TBLMRN ( [PART#], SUPPLIER, DESCRIPTION, T24m, T12m, 12MSL, 9msl, 6MSL, 3MSL, INSTOCK, 1mns, 1M, 1_5M, 2M, 3M, 4M, 5M, ONORDER, SHIPPING, TYG_TW, TYG_TX, GD, GN, KS, TYG_TW_P, TYG_TX_P, GD_P, GN_P, KS_P, KV_P, TYG_TW_K, TYG_TX_K, GD_K, GN_K, KS_K, KV_K, [TYG_TW#], [TYG_TX#], [GD#], [GN#], [KS#], [KV#], REMARK, DNK_MEMO, TYG_TW_MEMO, TYG_TX_MEMO, GD_MEMO, GN_MEMO, KS_MEMO, KV_MEMO, RATE, TYG_TW_C, TYG_TX_C, GD_C, GN_C, KS_C, TYG_TW_BO, TYG_TX_BO, GD_BO, GN_BO, KS_BO, OEM_NO, PARTLINK, SUGGEST, TYG_TW_STATUS, TYG_TX_STATUS, GD_STATUS, GN_STATUS, KS_STATUS, NEW, CAPA, MANUAL ) " +
//                           "SELECT ITEM_NO, NULL, DESCRIPT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, IIF(ISNULL(TYG_TW_PRC),0,TYG_TW_PRC), IIF(ISNULL(TYG_TX_PRC),0,TYG_TX_PRC), IIF(ISNULL(GD_PRC),0,GD_PRC), IIF(ISNULL(GN_PRC),0,GN_PRC), IIF(ISNULL(AM_PRC),0,AM_PRC), IIF(ISNULL(KV_PRC),0,KV_PRC), IIF(ISNULL(TYG_TW_PKG),0,TYG_TW_PKG), IIF(ISNULL(TYG_TX_PKG),0,TYG_TX_PKG), IIF(ISNULL(GD_PKG),0,GD_PKG), IIF(ISNULL(GN_PKG),0,GN_PKG), IIF(ISNULL(AM_PKG),0,AM_PKG), IIF(ISNULL(KV_PKG),0,KV_PKG), TYG_TW_NO, TYG_TX_NO, GD_NO, GN_NO, AM_NO, KV_NO, NULL, REMARK, TYG_REMARK, TX_REMARK, GD_REMARK, GN_REMARK, NULL, KV_REMARK, 0, IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(GD_CUFT),0,GD_CUFT), 0, 0, 0, 0, 0, 0, 0, PART_NO, PARTLINK, 0, NULL, NULL, NULL, NULL, NULL, 0, 0, 0 " +
//                           "FROM MIRRORM1 WHERE ITEM_NO NOT IN (SELECT [PART#] FROM TBLMRN);");

                // new Added additonal fields for DEPO vendor
//
//                st.execute("INSERT INTO TBLMRN ( [PART#],	SUPPLIER,	DESCRIPTION,	T24m,	T12m,	12MSL,	9msl,	6MSL,	3MSL,	INSTOCK,	1mns,	1M,	1_5M,	2M,	3M,	4M,	5M,	ONORDER,	SHIPPING,	TYG_TW,	TYG_TX,	GD,	GN,	KS,	TYG_TW_P,	TYG_TX_P,	GD_P,	GN_P,	KS_P,	KV_P,	TYG_TW_K,	TYG_TX_K,	GD_K,	GN_K,	KS_K,	KV_K,	[TYG_TW#],	[TYG_TX#],	[GD#],	[GN#],	[KS#],	[KV#],	REMARK,	DNK_MEMO,	TYG_TW_MEMO,	TYG_TX_MEMO,	GD_MEMO,	GN_MEMO,	KS_MEMO,	KV_MEMO,	RATE,	TYG_TW_C,	TYG_TX_C,	GD_C,	GN_C,	KS_C,	TYG_TW_BO,	TYG_TX_BO,	GD_BO,	GN_BO,	KS_BO,	OEM_NO,	PARTLINK,	SUGGEST,	TYG_TW_STATUS,	TYG_TX_STATUS,	GD_STATUS,	GN_STATUS,	KS_STATUS,	NEW,	CAPA,	MANUAL,	DEPO_P,	DEPO_K,	[DEPO#]) " +
//                        "SELECT ITEM_NO,	NULL,	DESCRIPT,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	0,	IIF(ISNULL(TYG_TW_PRC),0,TYG_TW_PRC),	IIF(ISNULL(TYG_TX_PRC),0,TYG_TX_PRC),	IIF(ISNULL(GD_PRC),0,GD_PRC),	IIF(ISNULL(GN_PRC),0,GN_PRC),	IIF(ISNULL(AM_PRC),0,AM_PRC),	IIF(ISNULL(KV_PRC),0,KV_PRC),	IIF(ISNULL(TYG_TW_PKG),0,TYG_TW_PKG),	IIF(ISNULL(TYG_TX_PKG),0,TYG_TX_PKG),	IIF(ISNULL(GD_PKG),0,GD_PKG),	IIF(ISNULL(GN_PKG),0,GN_PKG),	IIF(ISNULL(AM_PKG),0,AM_PKG),	IIF(ISNULL(KV_PKG),0,KV_PKG),	TYG_TW_NO,	TYG_TX_NO,	GD_NO,	GN_NO,	AM_NO,	KV_NO,	NULL,	REMARK,	TYG_REMARK,	TX_REMARK,	GD_REMARK,	GN_REMARK,	NULL,	KV_REMARK,	0,	IIF(ISNULL(TYG_CUFT),0,TYG_CUFT),	IIF(ISNULL(TYG_CUFT),0,TYG_CUFT),	IIF(ISNULL(GD_CUFT),0,GD_CUFT),	0,	0,	0,	0,	0,	0,	0,	PART_NO,	PARTLINK,	0,	NULL,	NULL,	NULL,	NULL,	NULL,	0,	0,	0,	IIF(ISNULL(DEPO_PRC),0,DEPO_PRC),	IIF(ISNULL(DEPO_PKG),0,DEPO_PKG), IIF(ISNULL(DEPO_NO),0,DEPO_NO) " +
//                        "FROM MIRRORM1 WHERE ITEM_NO NOT IN (SELECT [PART#] FROM TBLMRN);");

//                st.execute("INSERT INTO TBLMRN ( [PART#], SUPPLIER, DESCRIPTION, T24m, T12m, 12MSL, 9msl, 6MSL, 3MSL, INSTOCK, 1mns, 1M, 1_5M, 2M, 3M, 4M, 5M, ONORDER, SHIPPING, TYG_TW, TYG_TX, GD, GN, KS, TYG_TW_P, TYG_TX_P, GD_P, GN_P, KS_P, KV_P, TYG_TW_K, TYG_TX_K, GD_K, GN_K, KS_K, KV_K, [TYG_TW#], [TYG_TX#], [GD#], [GN#], [KS#], [KV#], REMARK, DNK_MEMO, TYG_TW_MEMO, TYG_TX_MEMO, GD_MEMO, GN_MEMO, KS_MEMO, KV_MEMO, RATE, TYG_TW_C, TYG_TX_C, GD_C, GN_C, KS_C, TYG_TW_BO, TYG_TX_BO, GD_BO, GN_BO, KS_BO, OEM_NO, PARTLINK, SUGGEST, TYG_TW_STATUS, TYG_TX_STATUS, GD_STATUS, GN_STATUS, KS_STATUS, NEW, CAPA, MANUAL,DEPO_P,	DEPO_K,	[DEPO#] ) " +
//                        "SELECT ITEM_NO, NULL, DESCRIPT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, IIF(ISNULL(TYG_TW_PRC),0,TYG_TW_PRC), IIF(ISNULL(TYG_TX_PRC),0,TYG_TX_PRC), IIF(ISNULL(GD_PRC),0,GD_PRC), IIF(ISNULL(GN_PRC),0,GN_PRC), IIF(ISNULL(AM_PRC),0,AM_PRC), IIF(ISNULL(KV_PRC),0,KV_PRC), IIF(ISNULL(TYG_TW_PKG),0,TYG_TW_PKG), IIF(ISNULL(TYG_TX_PKG),0,TYG_TX_PKG), IIF(ISNULL(GD_PKG),0,GD_PKG), IIF(ISNULL(GN_PKG),0,GN_PKG), IIF(ISNULL(AM_PKG),0,AM_PKG), IIF(ISNULL(KV_PKG),0,KV_PKG), TYG_TW_NO, TYG_TX_NO, GD_NO, GN_NO, AM_NO, KV_NO, NULL, REMARK, TYG_REMARK, TX_REMARK, GD_REMARK, GN_REMARK, NULL, KV_REMARK, 0, IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(TYG_CUFT),0,TYG_CUFT), IIF(ISNULL(GD_CUFT),0,GD_CUFT), 0, 0, 0, 0, 0, 0, 0, PART_NO, PARTLINK, 0, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, IIF(ISNULL(DEPO_PRC),0,DEPO_PRC),	IIF(ISNULL(DEPO_PKG),0,DEPO_PKG),	IIF(ISNULL(DEPO_NO),0,DEPO_NO) " +
//                        "FROM MIRRORM1 WHERE ITEM_NO NOT IN (SELECT [PART#] FROM TBLMRN);");



                st.execute("UPDATE TBLBCN AS A INNER JOIN TBLINVENTORY AS B ON A.[PART#]=B.[PART#] SET A.DESCRIPTION = B.DESCRIPTION WHERE A.DESCRIPTION <> B.DESCRIPTION OR ISNULL(A.DESCRIPTION);");
                st.execute("UPDATE TBLCLN AS A INNER JOIN TBLINVENTORY AS B ON A.[PART#]=B.[PART#] SET A.DESCRIPTION = B.DESCRIPTION WHERE A.DESCRIPTION <> B.DESCRIPTION OR ISNULL(A.DESCRIPTION);");
                st.execute("UPDATE TBLHFN AS A INNER JOIN TBLINVENTORY AS B ON A.[PART#]=B.[PART#] SET A.DESCRIPTION = B.DESCRIPTION WHERE A.DESCRIPTION <> B.DESCRIPTION OR ISNULL(A.DESCRIPTION);");
                st.execute("UPDATE TBLLTN AS A INNER JOIN TBLINVENTORY AS B ON A.[PART#]=B.[PART#] SET A.DESCRIPTION = B.DESCRIPTION WHERE A.DESCRIPTION <> B.DESCRIPTION OR ISNULL(A.DESCRIPTION);");
                st.execute("UPDATE TBLMRN AS A INNER JOIN TBLINVENTORY AS B ON A.[PART#]=B.[PART#] SET A.DESCRIPTION = B.DESCRIPTION WHERE A.DESCRIPTION <> B.DESCRIPTION OR ISNULL(A.DESCRIPTION);");
                st.execute("UPDATE TBLOTN AS A INNER JOIN TBLINVENTORY AS B ON A.[PART#]=B.[PART#] SET A.DESCRIPTION = B.DESCRIPTION WHERE A.DESCRIPTION <> B.DESCRIPTION OR ISNULL(A.DESCRIPTION);");

                tStop = System.currentTimeMillis();
                //System.out.print("\nStep 2/3 (Update CATS Description from TBLInventory) : " + (tStop - tStart) / 1000 + " Seconds");
                tStart = System.currentTimeMillis();


                st.execute("UPDATE TBLBCN AS A INNER JOIN TBLINVENTORY AS B ON A.[PART#]=B.[PART#] SET A.POSITION = B.POSITION WHERE A.POSITION <> B.POSITION OR ISNULL(A.POSITION);");
                st.execute("UPDATE TBLCLN AS A INNER JOIN TBLINVENTORY AS B ON A.[PART#]=B.[PART#] SET A.POSITION = B.POSITION WHERE A.POSITION <> B.POSITION OR ISNULL(A.POSITION);");
                st.execute("UPDATE TBLHFN AS A INNER JOIN TBLINVENTORY AS B ON A.[PART#]=B.[PART#] SET A.POSITION = B.POSITION WHERE A.POSITION <> B.POSITION OR ISNULL(A.POSITION);");
                st.execute("UPDATE TBLLTN AS A INNER JOIN TBLINVENTORY AS B ON A.[PART#]=B.[PART#] SET A.POSITION = B.POSITION WHERE A.POSITION <> B.POSITION OR ISNULL(A.POSITION);");
                st.execute("UPDATE TBLMRN AS A INNER JOIN TBLINVENTORY AS B ON A.[PART#]=B.[PART#] SET A.POSITION = B.POSITION WHERE A.POSITION <> B.POSITION OR ISNULL(A.POSITION);");
                st.execute("UPDATE TBLOTN AS A INNER JOIN TBLINVENTORY AS B ON A.[PART#]=B.[PART#] SET A.POSITION = B.POSITION WHERE A.POSITION <> B.POSITION OR ISNULL(A.POSITION);");

                tStop = System.currentTimeMillis();
                //System.out.println("\nStep 3/3 (Update CATS Position from TBLInventory) : " + (tStop - tStart) / 1000 + " Seconds");
//                JOptionPane.showMessageDialog(null, "\nTotal time: " + ((tStop - tTotal) / 1000) / 60 + " Minutes");

                st.close();
                st1.close();
                st2.close();
                st3.close();
                st4.close();
                st5.close();
                st6.close();
                con.close();
            }
            catch(SQLException er)
            {
                JOptionPane.showMessageDialog(null, er);
                er.printStackTrace();
            }
        }
        catch(Exception e)
        {
            JOptionPane.showMessageDialog(null, e);
            e.printStackTrace();
        }
    }
}